package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.Result;
import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.Order;
import com.itheima.pojo.OrderSetting;
import com.itheima.service.LocalOrderService;
import com.itheima.service.OrderService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/localorder")
public class LocalOrderController {

    @Reference
    private LocalOrderService localOrderService;
    @Reference
    private OrderService orderService;

    //新增预约
    @RequestMapping("/submit")
    public Result add( Map<String,Object> map, Integer[] setmealIds){

        Result result = null;

        try{
            localOrderService.add(map,setmealIds);
        }catch (Exception e){
            e.printStackTrace();
            //return new Result(false, MessageConstant.ORDERSETTING_SUCCESS);//新增失败
            return result;
        }
        //return new Result(true,MessageConstant.ORDERSETTING_FAIL);//新增成功
        return result;
    }
}
